1. Technical Field
The invention disclosed broadly relates to data processing methods and more particularly relates to an improved method for copying a marked portion of a structured document.
2. Background Art
Current editors provide a block copy function which allows a user to copy a marked portion of a document. These copy functions copy only what is marked. If a matched pair of formatting controls or tags are required to provide particular formatting (e.g.--boldface type) and only one control or tag is included in the mark, the block copy will copy an unmatched control. Although this type of copy is flexible and never fails, it normally causes the target document to become invalid (i.e.--incorrectly formatted or mis-structured).
In an editor which supports structured documents, this same type of unstructured copy could result in a document whose structure is invalid (i.e. no longer adheres to the defined hierarchy of elements) if only one tag of a matched pair is included in the mark. This result would force the user to manually repair the target document structure by inserting the missing tags. This repair is necessary to assure the correct formatting of the target document.
In a non-WYSIWYG environment (one in which the structuring tags are displayed), this repair process would be difficult for a user who does not fully understand the target document structure and tedious for the more advanced user. In a WYSIWYG environment (one in which the structuring tags are not displayed), repair of the target document structure would be difficult for the advanced user and extremely difficult (maybe impossible) for a user who does not understand the structure of the target document.
The following terminology is used throughout this disclosure.
SGML Standardized General Markup Language. A markup language consisting of begin and end tags used to prepare structured documents. Refer to International Standards Organization standard 8879-1986 for definition and details.
Element. SGML-defined entity consisting of a begin tag and its content (including an end tag if necessary).
Root Element. The outermost element in a structured document which packages or surrounds all contents of the document.
Structured Document. A document which has a defined hierarchy of elements such as that defined by SGML.
Mark. A portion of a document, visually altered (i.e.--highlighted, reverse-videoed) to indicate its selection for processing (e.g.--moving, copying, deleting, translating to uppercase, etc.).
Beginning of Mark. The document position, closest to the beginning of a document, which defines the starting boundary of a mark.
End of Mark. The document position, closest to the end of a document, which defines the ending boundary of a mark.
Current Document Position. The document position which determines the focal point for an editing operation, usually the location of the cursor.
Source Document. A document which contains the mark.
Target Document. A document which contains the location to which the contents of the mark will be copied.
Target Location. The document position contained in the target document at which the contents of the mark will be inserted. Note that the target location can be contained within the document which contains the mark, but cannot be contained within the mark itself.
WYSIWYG. An acronym for "What you see is what you get." The term refers to the display of edited text in the same form as it will appear when printed.